home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / frame_18 / PlaceObject2_822_87 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Encoding:
Text File  |  2008-09-24  |  1.2 KB  |  64 lines

  1. onClipEvent(load){
  2.    function changeDir()
  3.    {
  4.       dir = random(2);
  5.       if(dir == 0)
  6.       {
  7.          dir = "left";
  8.       }
  9.       if(dir == 1)
  10.       {
  11.          dir = "right";
  12.       }
  13.    }
  14.    function bomb()
  15.    {
  16.       if(_root.paused)
  17.       {
  18.          return undefined;
  19.       }
  20.       if(health <= 0)
  21.       {
  22.          return undefined;
  23.       }
  24.       c = random(3);
  25.       if(c == 0)
  26.       {
  27.          type = "fuel";
  28.       }
  29.       if(c == 1)
  30.       {
  31.          type = "bomb";
  32.       }
  33.       if(c == 2)
  34.       {
  35.          type = "bomb";
  36.       }
  37.       var _loc2_ = type + i;
  38.       i++;
  39.       _root.attachMovie(type,_loc2_,i);
  40.       _root[_loc2_]._x = _X + _width / 2;
  41.       _root[_loc2_]._y = _Y + 50;
  42.    }
  43.    if(_root.sound)
  44.    {
  45.       ufoS = new Sound(this);
  46.       ufoS.attachSound("ufo");
  47.       ufoS.setVolume(70);
  48.       ufoS.start(0,9999);
  49.       explode1 = new Sound(this);
  50.       explode1.attachSound("explode2");
  51.       explode = new Sound(this);
  52.       explode.attachSound("explode1");
  53.    }
  54.    damage = false;
  55.    health = 100;
  56.    speed = 2;
  57.    delay = 4000;
  58.    resetTime = getTimer() + delay;
  59.    time = 0;
  60.    t = 0;
  61.    changeDir();
  62.    i = 1;
  63. }
  64.